package smetana.modules.ui;

import com.google.inject.AbstractModule;
import smetana.modules.ui.actions.*;
import smetana.modules.ui.form.about.AboutProgramPanel;
import smetana.modules.ui.form.common.SelectFilePanel;
import smetana.modules.ui.form.doc.DocEditPanel;
import smetana.modules.ui.form.doc.DocListPanel;
import smetana.modules.ui.form.doc.ProductsCartPanel;
import smetana.modules.ui.form.doc.ProductsCatalogPanel;
import smetana.modules.ui.form.io.ImportFromDbfPanel;
import smetana.modules.ui.form.io.ImportPriceListPanel;
import smetana.modules.ui.form.search.SearchAgentDialog;
import smetana.modules.ui.form.search.SearchManagerDialog;
import smetana.modules.ui.form.window.MainMenuPanel;
import smetana.modules.ui.form.window.ToolbarPanel;
import smetana.modules.ui.form.window.WorkPanel;
import smetana.modules.ui.model.CursorDoc;
import smetana.modules.ui.model.CursorPosition;
import smetana.modules.ui.model.UIModel;

/**
 *
 * @author dmitry.mamonov
 */
public class UIModule extends AbstractModule {
    @Override
    protected void configure() {
        //bind model
        bind(UIModel.class).asEagerSingleton();

        //bind cursor.
        bind(CursorDoc.class).asEagerSingleton();
        bind(CursorPosition.class).asEagerSingleton();

        //bind actions
        bind(CreateDocumentAction.class).asEagerSingleton();
        bind(EditDocumentAction.class).asEagerSingleton();
        bind(SaveDocumentAction.class).asEagerSingleton();
        bind(DeleteDocumentAction.class).asEagerSingleton();
        bind(ExportDocumentAction.class).asEagerSingleton();
        bind(PrintDocumentAction.class).asEagerSingleton();
        bind(ExitAction.class).asEagerSingleton();
        bind(SettingsAction.class).asEagerSingleton();
        bind(ImportPriceListAction.class).asEagerSingleton();
        bind(DBBackupAction.class).asEagerSingleton();
        bind(DBRestoreAction.class).asEagerSingleton();
        bind(AboutAction.class).asEagerSingleton();
        bind(MailToMeAction.class).asEagerSingleton();
        bind(ImportFromDbfAction.class).asEagerSingleton();

        //bind panels
        bind(ToolbarPanel.class).asEagerSingleton();
        bind(DocEditPanel.class).asEagerSingleton();
        bind(DocListPanel.class).asEagerSingleton();
        bind(MainMenuPanel.class).asEagerSingleton();
        bind(WorkPanel.class).asEagerSingleton();
        bind(ProductsCatalogPanel.class).asEagerSingleton();
        bind(ProductsCartPanel.class).asEagerSingleton();
        bind(SearchAgentDialog.class);
        bind(SearchManagerDialog.class);
        bind(ImportPriceListPanel.class);
        bind(ImportFromDbfPanel.class);
        bind(SelectFilePanel.class);
        bind(AboutProgramPanel.class);
    }
}
